package com.eportal.service;
import com.alibaba.fastjson.JSONObject;
import com.eportal.domain.FeeAlipayAuth;
import com.eportal.domain.Sysopt;
import com.eportal.entity.FeeAlipayAuthEntity;
import com.framework.jqgrid.JqGridPager;
import com.framework.jqgrid.PageEntity;
import com.github.pagehelper.PageInfo;

import java.util.List;
import java.util.Map;


public interface FeeAlipayAuthService  extends BaseService<FeeAlipayAuthEntity>{

	List<FeeAlipayAuth> list(String agtCode, String auth_status);

	List<Map<String, Object>> list(JqGridPager jqGridPager);

	FeeAlipayAuth getFeeAlipayAuth(Long sid);

	Map<String, Object> addMethod(FeeAlipayAuth feeAlipayAuth);

	Map<String, Object> updateMethod(FeeAlipayAuth feeAlipayAuth);

	Map<String, Object> deleteMethod(String ids);

	Map<String, String> getDetailBySql(String sql);

	Map<String, Object> codeChangeTokenMethod(String sid,String app_id, String app_auth_code);


//todo ---------------------------------------------------------------------------------------------

	/**
	 * 支付宝授权管理列表
	 * @author Saber
	 * @Date 2017/8/22 下午6:47
	 * @param agtCode			  合作方code
	 * @param pageEntity          分页对象
	 * @param user                当前用户
	 * @param userRole            当前用户userRole
	 * @see FeeAlipayAuthService#list(JqGridPager)
	 * @return
	 */
	PageInfo<FeeAlipayAuthEntity> queryForPage(String agtCode, PageEntity pageEntity, Sysopt user, int userRole);

	/**
	 * 支付宝授权新增
	 * @author Saber
	 * @Date 2017/8/23 上午10:03
	 * @param entity		对象
	 * @param user			当前用户
	 * @param userRole		当前用户userRole
	 * @see FeeAlipayAuthService#addMethod(FeeAlipayAuth)
	 * @return
	 */
	JSONObject add(FeeAlipayAuthEntity entity, Sysopt user, int userRole);

	/**
	 * 支付宝授权修改
	 * @author Saber
	 * @Date 2017/8/23 下午1:18
	 * @param entity		对象
	 * @param user			当前用户
	 * @param userRole		当前用户userRole
	 * @see FeeAlipayAuthService#updateMethod(FeeAlipayAuth)
	 * @return
	 */
	JSONObject update(FeeAlipayAuthEntity entity, Sysopt user, int userRole);

	/**
	 * 使用app_auth_code换取app_auth_token
	 * @author Saber
	 * @Date 2017/8/23 下午2:19
	 * @param sid
	 * @param app_id
	 * @param app_auth_code		授权码
	 * @see FeeAlipayAuthService#codeChangeTokenMethod(String, String, String)
	 * @return
	 */
	JSONObject codeChangeToken(Long sid, String app_id, String app_auth_code);
}
